From a80a083a0ef30c476d214da81a6eccfb3d64d76e Mon Sep 17 00:00:00 2001 From: Ewan Mellor Date: Thu, 28 Dec 2006 15:52:31 +0000 Subject: [PATCH] Format Xen-API error messages nicely. Signed-off-by: Ewan Mellor --- tools/python/xen/xm/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/python/xen/xm/main.py b/tools/python/xen/xm/main.py index 5f27680a5e..3feb864f16 100644 --- a/tools/python/xen/xm/main.py +++ b/tools/python/xen/xm/main.py @@ -1780,7 +1780,8 @@ def _run_cmd(cmd, cmd_name, args): except SystemExit, code: return code == 0, code except XenAPI.Failure, exn: - print >>sys.stderr, str(exn) + for line in [''] + wrap(str(exn), 80) + ['']: + print >>sys.stderr, line except xmlrpclib.Fault, ex: if ex.faultCode == XendClient.ERROR_INVALID_DOMAIN: err("Domain '%s' does not exist." % ex.faultString) -- 2.30.2